<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>基于SSM的英语单词背诵系统</title>
    <meta name="description" content="Ela Admin - HTML5 Admin Template">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="apple-touch-icon" href="https://i.imgur.com/QRAUqs9.png">
    <link rel="shortcut icon" href="https://i.imgur.com/QRAUqs9.png">

    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/normalize.css@8.0.0/normalize.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.1.3/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/lykmapipo/themify-icons@0.1.2/css/themify-icons.css">
    <link rel="stylesheet"
          href="https://cdn.jsdelivr.net/npm/pixeden-stroke-7-icon@1.2.3/pe-icon-7-stroke/dist/pe-icon-7-stroke.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.2.0/css/flag-icon.min.css">
    <link rel="stylesheet" th:href="@{/static/css/cs-skin-elastic.css}">
    <link rel="stylesheet" th:href="@{/static/css/style.css}">

    <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800' rel='stylesheet' type='text/css'>


</head>

<body>


<!-- Left Panel -->
<div th:replace="common/admin-leftbar::leftbar"/>


<div id="right-panel" class="right-panel">

    <!-- Header-->
    <!-- Header-->
    <!-- Header-->
    <header id="header" class="header">
        <div class="top-left">
            <div class="navbar-header">
                <a class="navbar-brand" th:href="@{/admin/main}"><img th:src="@{/static/images/logo.png}"
                                                                      alt="Logo"></a>
                <a class="navbar-brand hidden" href=""><img src="../../static/images/logo2.png" alt="Logo"></a>
                <a id="menuToggle" class="menutoggle"><i class="fa fa-bars"></i></a>
            </div>
        </div>


        <!-- 导航栏-->
        <div class="top-right">
            <div class="header-menu">
                <div class="header-left">
                    <div class="dropdown for-notification">
                        管理员您好！
                        <button class="btn btn-secondary dropdown-toggle" type="button" id="notification"
                                data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                            <i class="fa fa-user-secret"></i>
                        </button>

                        <div class="dropdown-menu" aria-labelledby="notification">
                            <p class="red">控制中心</p>
                            <a class="dropdown-item media" th:href="@{/templates/admin/main.html}">
                                <i class="f fa fa-user"></i>
                                <p>普通用户</p>
                            </a>
                            <a class="dropdown-item media" th:href="@{/logout}">
                                <i class="fa fa-power-off"></i>
                                <p>退出登录</p>
                            </a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </header>

    <div class="breadcrumbs">
        <div class="breadcrumbs-inner">
            <div class="row m-0">
                <div class="col-sm-4">
                    <div class="page-header float-left">
                        <div class="page-title">
                            <h1>当前位置</h1>
                        </div>
                    </div>
                </div>
                <div class="col-sm-8">
                    <div class="page-header float-right">
                        <div class="page-title">
                            <ol class="breadcrumb text-right">
                                <li><a href="#">主页</a></li>
                                <li><a href="#">操作</a></li>
                                <li class="active">用户管理</li>
                            </ol>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="content">
        <div class="row">
            <div class="col-lg-12">
                <div class="card">
                    <div class="card-header">
                        <strong>修改用户</strong>
                    </div>
                    <div class="card-body card-block">
                        <form th:action="@{/admin/updateUser/}+${user.getUserId()}" method="post">
                            <div class="form-group">
                                <div class="input-group">
                                    <div class="input-group-addon"><i class="fa fa-user"></i></div>
                                    <input th:value="${user.getUserName()}" name="userName" placeholder="Username"
                                           class="form-control">
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="input-group">
                                    <div class="input-group-addon"><i class="fa fa-envelope"></i></div>
                                    <input th:value="${user.getEmail()}" type="email" name="email" placeholder="Email"
                                           class="form-control">
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="input-group">
                                    <div class="input-group-addon"><i class="fa fa-asterisk"></i></div>
                                    <input th:value="${user.getPassword()}" id="password" name="password"
                                           placeholder="Password" class="form-control">
                                </div>
                            </div>


                            <div class="form-group">
                                <label for="numNewWordsMaxDay" class="form-label">每日计划新词数</label>
                                <div class="input-group">
                                    <div class="input-group-addon"><i class="fa fa-book"></i></div>
                                    <select class="form-control" id="numNewWordsMaxDay" name="numNewWordsMaxDay" placeholder="" required >
                                        <div th:each="number: ${maxNewWordsNumList}" >
                                            <div th:switch="${number==user.getNumNewWordsMaxDay()}">
                                                <option th:text="${number}" th:value="${number}" th:case="true" selected></option>
                                                <option th:text="${number}" th:value="${number}" th:case="false"></option>
                                            </div>
                                        </div>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="numWordsMaxReview" class="form-label">每日计划复习数</label>
                                <div class="input-group">
                                    <div class="input-group-addon"><i class="fa fa-book"></i></div>
                                    <select class="form-control" id="numWordsMaxReview" name="numWordsMaxReview" placeholder="" required >
                                        <div th:each="number: ${maxReviewedWordsNumList}" >
                                            <div th:switch="${number==user.getNumWordsMaxReview()}">
                                                <option th:text="${number}" th:value="${number}" th:case="true" selected></option>
                                                <option th:text="${number}" th:value="${number}" th:case="false"></option>
                                            </div>
                                        </div>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <p>当前积分:</p>
                                <div class="input-group">
                                    <div class="input-group-addon"><i class="fa fa-book"></i></div>
                                    <input th:value="${user.getScore()}" id="score" name="score" placeholder=""
                                           class="form-control">
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="input-group">
                                    <div class="input-group-addon"><i class="fa fa-asterisk"></i></div>
                                    <select name="role" id="select" th:switch="${user.getRole()==0}" class="form-control">
                                        <div th:case="true">
                                            <option value="0" selected>普通用户</option>
                                            <option value="1">管理员</option>
                                        </div>
                                        <div th:case="false">
                                            <option value="0">普通用户</option>
                                            <option value="1"  selected>管理员</option>
                                        </div>
                                    </select>
                                </div>
                            </div>

                            <div class="form-actions form-group">
                                <button type="submit" class="btn btn-success btn-sm">修改</button>
                            </div>
                        </form>

                    </div>
                </div>
            </div>

        </div>

    </div><!-- .content -->

    <div class="clearfix"></div>

    <div th:replace="common/footer::footer"/>


</div><!-- /#right-panel -->


<script src="https://cdn.jsdelivr.net/npm/jquery@2.2.4/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.14.4/dist/umd/popper.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.1.3/dist/js/bootstrap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery-match-height@0.7.2/dist/jquery.matchHeight.min.js"></script>
<script th:src="@{/static/js/main.js}"></script>
</body>
</html>